﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Content.Master" Inherits="System.Web.Mvc.ViewPage<MethodWorx.CMS.UI.Models.ApplicationSettingsModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MethodWorx CMS - Application Settings
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script language="javascript">

        $(document).ready(function () {
            showHideApplicationTypeHelp($("#applicationTypeId").val());
            $("#applicationTypeId").change(function () {
                showHideApplicationTypeHelp($(this).val());
            });

        });

        function showHideApplicationTypeHelp(id) {
            $(".applicationTypeHelp").hide();
            $("#applicationTypeHelp" + id).show();
        }
    </script>

    <h2>Application Settings</h2>
    <%using(Html.BeginForm()){ %>
    <%=Html.Hidden("fromContent") %>
    <div class="formItem">
        <em>
            <img src="<%=Url.Content("~/Images/icons/exclamation.png")%>"/>
            <strong>Warning:</strong> changing these settings may have an effect on the operation of your website.  It is recommended to make these changes at the beginning of your CMS project.
        </em>
    </div>

    <div class="formItem">
        <label>Application Type</label>
        <%=Html.DropDownList("applicationTypeId", this.Model.GetApplicationTypeSelectList(), "Please Select...") %><br />
        <%=Html.ValidationMessage("applicationTypeId") %>
        <div style="padding-left:145px;padding-top:5px;">
            <%foreach(var at in this.Model.ApplicationTypes) {%>
                <em>
                <span id="applicationTypeHelp<%=at.ApplicationTypeId %>" style="display:none"class="applicationTypeHelp" >
                    <%=at.Description %>
                </span>
                </em>
            <%} %>
        </div>
    </div>

    <%=Html.FormTextBox("Base Uri", "baseUri", this.Model.BaseUri)%>
    <%=Html.FormButtons(b =>
    {
        b.Submit("save", "Save");
        if(this.ViewData.Model.FromContent)
            b.LinkButton("cancel", "Cancel", Url.Content("~/Content"));
        else
            b.LinkButton("cancel", "Cancel", Url.Content("~/Administration"));
    }) %>
    <%} %>
    

</asp:Content>
